package com.faceye.core.util.request;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 批量删除請求参数
 */
@Data
public class BatchRemoveRequest implements Serializable {
    private String ids = "";

    public Long[] getIDArray() {
        List<Long> idArray = new ArrayList<Long>(0);
        if (StringUtils.isNotEmpty(ids)) {
            String [] idsArray =StringUtils.split(ids,",");
            for(String id:idsArray){
                idArray.add(NumberUtils.toLong(id));
            }
        }
        return idArray.toArray(new Long[0]);
    }
}
